$(function () {
    function getUserMsgNum() {
        var urls = opWebPath +'/web/op/message/ajax/getMessageNum';
        $.ajax({
            url: urls,
            type: "post",
            dataType: "jsonp",
            jsonp: "callback", //服务端用于接收callback调用的function名的参数
            jsonpCallback: "user_msg_num_callback", //callback的function名称,服务端会把名称和data一起传递回来
            success: function(json) {
                var num = parseInt(json);
                if(num>0){
                    $("#head-keNum-pointer").removeClass('hide');
                    $("#head-keNum-pointer").text(num);
                }
            },
            error: function(error){
                console.info("-----获取消息数据失败");
            }
        });
    }

    getUserMsgNum();
});
